package com.hsnn.medstgmini.base.std.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.format.annotation.DateTimeFormat;

import com.hsnn.medstgmini.model.DrugStatus;
import com.hsnn.medstgmini.util.DateUtil;

/**
 * StdExpertLog entity. 专家维护记录库 std_expert_log
 */
@Entity
@Table(name = "std_expert_log")
public class StdExpertLog implements Serializable {

	private static final long serialVersionUID = 1L;

	// Fields

	private String logId;					//ID
	private String expertCode;				//编号
	private String name;					//姓名
	private String sex;						//性别
	private String idNum;					//身份证号码
	private String politicalStatus;			//政治面貌
	private Date birthday;					//出生日期
	private String eduBg;					//最高学历
	private String eduDegree;				//最高学位
	private String techPos;					//职称
	private String techPosCertNo;			//职称证书号
	private String position;				//职务
	private String industry;				//所属行业
	private String profession;				//从事专业
	private Integer profesExper;			//从事专业年限
	private String practLicense1;			//执业资格1
	private String practLicenseCertNo1;		//执业资格证书号1
	private String practLicense2;			//执业资格2
	private String practLicenseCertNo2;		//执业资格证书号2
	private String practLicense3;			//执业资格3
	private String practLicenseCertNo3;		//执业资格证书号3
	private String practLicense4;			//执业资格4
	private String practLicenseCertNo4;		//执业资格证书号4
	private String practLicense5;			//执业资格5
	private String practLicenseCertNo5;		//执业资格证书号5
	private String scoreArea1;				//评标专业1
	private String scoreArea2;				//评标专业2
	private String scoreArea3;				//评标专业3
	private String areaId;					//地区
	private String serviceYear;				//工龄
	private short retired;					//是否退休1未退休0退休
	private String university;				//毕业院校
	private String major;					//所学专业
	private String companyId;				//工作单位
	private String orgId;					//组织机构代码
	private String companyAddr;				//单位地址
	private String homeAddr;				//家庭地址
	private String handphone;				//移动电话
	private String compPhone;				//单位电话
	private String telephone;				//住宅电话
	private String zipcode;					//邮政编码
	private String email;					//电子邮件
	private String expSkills;				//专业技术特长
	private String scoreYesrs;				//评标经验
	private String remark;					//备注
	private Integer status;					//状态1有效2作废
	private String statusName;				// 状态名称
	private Date updDatetime;				//更新时间
	private String updUser;					//更新人
	private String expertId;
	
	private String birthdayStr;				//出生日期显示格式转换
	private String updDatetimeStr;			//更新时间显示格式转换
	

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "log_id", unique = true, nullable = false, length = 36)
	public String getLogId() {
		return this.logId;
	}

	public void setLogId(String logId) {
		this.logId = logId;
	}
	
	@Column(name = "expert_code",length = 36)
	public String getExpertCode() {
		return this.expertCode;
	}

	public void setExpertCode(String expertCode) {
		this.expertCode = expertCode;
	}

	@Column(name = "name", length = 128)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "sex", length = 5)
	public String getSex() {
		return this.sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	@Column(name = "id_num", length = 20)
	public String getIdNum() {
		return this.idNum;
	}

	public void setIdNum(String idNum) {
		this.idNum = idNum;
	}

	@Column(name = "political_status", length = 10)
	public String getPoliticalStatus() {
		return this.politicalStatus;
	}

	public void setPoliticalStatus(String politicalStatus) {
		this.politicalStatus = politicalStatus;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "birthday", length = 19)
	public Date getBirthday() {
		return this.birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	@Column(name = "edu_bg", length = 20)
	public String getEduBg() {
		return this.eduBg;
	}

	public void setEduBg(String eduBg) {
		this.eduBg = eduBg;
	}

	@Column(name = "edu_degree", length = 50)
	public String getEduDegree() {
		return this.eduDegree;
	}

	public void setEduDegree(String eduDegree) {
		this.eduDegree = eduDegree;
	}

	@Column(name = "tech_pos", length = 128)
	public String getTechPos() {
		return this.techPos;
	}

	public void setTechPos(String techPos) {
		this.techPos = techPos;
	}

	@Column(name = "tech_pos_cert_no", length = 128)
	public String getTechPosCertNo() {
		return this.techPosCertNo;
	}

	public void setTechPosCertNo(String techPosCertNo) {
		this.techPosCertNo = techPosCertNo;
	}

	@Column(name = "position", length = 128)
	public String getPosition() {
		return this.position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	@Column(name = "industry", length = 256)
	public String getIndustry() {
		return this.industry;
	}

	public void setIndustry(String industry) {
		this.industry = industry;
	}

	@Column(name = "profession", length = 256)
	public String getProfession() {
		return this.profession;
	}

	public void setProfession(String profession) {
		this.profession = profession;
	}

	@Column(name = "profes_exper")
	public Integer getProfesExper() {
		return this.profesExper;
	}

	public void setProfesExper(Integer profesExper) {
		this.profesExper = profesExper;
	}

	@Column(name = "pract_license1", length = 128)
	public String getPractLicense1() {
		return this.practLicense1;
	}

	public void setPractLicense1(String practLicense1) {
		this.practLicense1 = practLicense1;
	}

	@Column(name = "pract_license_cert_no1", length = 128)
	public String getPractLicenseCertNo1() {
		return this.practLicenseCertNo1;
	}

	public void setPractLicenseCertNo1(String practLicenseCertNo1) {
		this.practLicenseCertNo1 = practLicenseCertNo1;
	}

	@Column(name = "pract_license2", length = 128)
	public String getPractLicense2() {
		return this.practLicense2;
	}

	public void setPractLicense2(String practLicense2) {
		this.practLicense2 = practLicense2;
	}

	@Column(name = "pract_license_cert_no2", length = 128)
	public String getPractLicenseCertNo2() {
		return this.practLicenseCertNo2;
	}

	public void setPractLicenseCertNo2(String practLicenseCertNo2) {
		this.practLicenseCertNo2 = practLicenseCertNo2;
	}

	@Column(name = "pract_license3", length = 128)
	public String getPractLicense3() {
		return this.practLicense3;
	}

	public void setPractLicense3(String practLicense3) {
		this.practLicense3 = practLicense3;
	}

	@Column(name = "pract_license_cert_no3", length = 128)
	public String getPractLicenseCertNo3() {
		return this.practLicenseCertNo3;
	}

	public void setPractLicenseCertNo3(String practLicenseCertNo3) {
		this.practLicenseCertNo3 = practLicenseCertNo3;
	}

	@Column(name = "pract_license4", length = 128)
	public String getPractLicense4() {
		return this.practLicense4;
	}

	public void setPractLicense4(String practLicense4) {
		this.practLicense4 = practLicense4;
	}

	@Column(name = "pract_license_cert_no4", length = 128)
	public String getPractLicenseCertNo4() {
		return this.practLicenseCertNo4;
	}

	public void setPractLicenseCertNo4(String practLicenseCertNo4) {
		this.practLicenseCertNo4 = practLicenseCertNo4;
	}

	@Column(name = "pract_license5", length = 128)
	public String getPractLicense5() {
		return this.practLicense5;
	}

	public void setPractLicense5(String practLicense5) {
		this.practLicense5 = practLicense5;
	}

	@Column(name = "pract_license_cert_no5", length = 128)
	public String getPractLicenseCertNo5() {
		return this.practLicenseCertNo5;
	}

	public void setPractLicenseCertNo5(String practLicenseCertNo5) {
		this.practLicenseCertNo5 = practLicenseCertNo5;
	}

	@Column(name = "score_area1", length = 128)
	public String getScoreArea1() {
		return this.scoreArea1;
	}

	public void setScoreArea1(String scoreArea1) {
		this.scoreArea1 = scoreArea1;
	}

	@Column(name = "score_area2", length = 128)
	public String getScoreArea2() {
		return this.scoreArea2;
	}

	public void setScoreArea2(String scoreArea2) {
		this.scoreArea2 = scoreArea2;
	}

	@Column(name = "score_area3", length = 128)
	public String getScoreArea3() {
		return this.scoreArea3;
	}

	public void setScoreArea3(String scoreArea3) {
		this.scoreArea3 = scoreArea3;
	}

	@Column(name = "area_id", length = 128)
	public String getAreaId() {
		return this.areaId;
	}

	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}

	@Column(name = "service_year", length = 10)
	public String getServiceYear() {
		return this.serviceYear;
	}

	public void setServiceYear(String serviceYear) {
		this.serviceYear = serviceYear;
	}

	@Column(name = "retired")
	public short getRetired() {
		return this.retired;
	}

	public void setRetired(short retired) {
		this.retired = retired;
	}

	@Column(name = "university", length = 128)
	public String getUniversity() {
		return this.university;
	}

	public void setUniversity(String university) {
		this.university = university;
	}

	@Column(name = "major", length = 128)
	public String getMajor() {
		return this.major;
	}

	public void setMajor(String major) {
		this.major = major;
	}

	@Column(name = "company_id", length = 256)
	public String getCompanyId() {
		return this.companyId;
	}

	public void setCompanyId(String companyId) {
		this.companyId = companyId;
	}

	@Column(name = "org_id", length = 20)
	public String getOrgId() {
		return this.orgId;
	}

	public void setOrgId(String orgId) {
		this.orgId = orgId;
	}

	@Column(name = "company_addr", length = 512)
	public String getCompanyAddr() {
		return this.companyAddr;
	}

	public void setCompanyAddr(String companyAddr) {
		this.companyAddr = companyAddr;
	}

	@Column(name = "home_addr", length = 512)
	public String getHomeAddr() {
		return this.homeAddr;
	}

	public void setHomeAddr(String homeAddr) {
		this.homeAddr = homeAddr;
	}

	@Column(name = "handphone", length = 20)
	public String getHandphone() {
		return this.handphone;
	}

	public void setHandphone(String handphone) {
		this.handphone = handphone;
	}

	@Column(name = "comp_phone", length = 20)
	public String getCompPhone() {
		return this.compPhone;
	}

	public void setCompPhone(String compPhone) {
		this.compPhone = compPhone;
	}

	@Column(name = "telephone", length = 20)
	public String getTelephone() {
		return this.telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	@Column(name = "zipcode", length = 10)
	public String getZipcode() {
		return this.zipcode;
	}

	public void setZipcode(String zipcode) {
		this.zipcode = zipcode;
	}

	@Column(name = "email", length = 64)
	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	@Column(name = "exp_skills", length = 256)
	public String getExpSkills() {
		return this.expSkills;
	}

	public void setExpSkills(String expSkills) {
		this.expSkills = expSkills;
	}

	@Column(name = "score_yesrs", length = 512)
	public String getScoreYesrs() {
		return this.scoreYesrs;
	}

	public void setScoreYesrs(String scoreYesrs) {
		this.scoreYesrs = scoreYesrs;
	}

	@Column(name = "remark", length = 512)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "status")
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "upd_datetime", length = 19)
	public Date getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user", length = 36)
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}
	
	@Column(name = "expert_id",length = 36)
	public String getExpertId() {
		return expertId;
	}

	public void setExpertId(String expertId) {
		this.expertId = expertId;
	}
	
	@Transient
	public String getBirthdayStr() {
		if (birthday != null) {
			birthdayStr = DateUtil.date(birthday);
		}
		return birthdayStr;
	}

	public void setBirthdayStr(String birthdayStr) {
		this.birthdayStr = birthdayStr;
	}

	@Transient
	public String getUpdDatetimeStr() {
		if(updDatetime != null){
			updDatetimeStr = DateUtil.dateTime(updDatetime);
		}
		return updDatetimeStr;
	}

	public void setUpdDatetimeStr(String updDatetimeStr) {
		this.updDatetimeStr = updDatetimeStr;
	}
	
	
	@Transient
	public String getStatusName() {
		if( status != null ){
			statusName = DrugStatus.getName(status);
		}
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}


}
